<?php
defined('IN_IA') or exit('Access Denied');
global $_W, $_GPC;
$op = !empty($_GPC['op']) ? $_GPC['op'] : 'delall_order';
if ('delall_order' == $op) {
	$list = pdo_fetch("SELECT * FROM " . tablename($this->tableorder) . " WHERE uniacid = '{$_W['uniacid']}'");
	if ($list) {
		pdo_delete($this->tableorder, array('uniacid' => $_W['uniacid']));
		message('操作成功！', $this->createWebUrl('listorder', array('op' => 'display')), 'success');
	} else {
		message('未发现任何订单！', $this->createWebUrl('listorder', array('op' => 'display')), 'error');
	}
}
if ('delall_order2' == $op) {
	$list = pdo_fetch("SELECT * FROM " . tablename($this->tableorder) . " WHERE uniacid = '{$_W['uniacid']}' and orderstatus='订单失效'");
	if ($list) {
		pdo_delete($this->tableorder, array('uniacid' => $_W['uniacid'], 'orderstatus' => '订单失效'));
		message('操作成功！', $this->createWebUrl('listorder', array('op' => 'display')), 'success');
	} else {
		message('未发现任何失效订单！', $this->createWebUrl('listorder', array('op' => 'display')), 'error');
	}
}